#ifndef _ALGO_FILTER_H
#define _ALGO_FILTER_H

#include "algorithm_conf.h"
#include "algo_math.h"

typedef struct _butterworth_buffer_t
{
	f32 Input_Butter[3];
	f32 Output_Butter[3];
} butterworth_buffer_t;

typedef struct _butterworth_parameter_t
{
	f32 a[3];
	f32 b[3];
} butterworth_parameter_t;

extern butterworth_parameter_t g_bandstop_filter_parameter_30_98;
extern butterworth_parameter_t g_bandstop_filter_parameter_30_94;
extern butterworth_parameter_t g_notch_filter_parameter_55hz;

void set_cutoff_frequency(butterworth_parameter_t *LPF, f32 sample_frequent, f32 cutoff_frequent); // 设定滤波器截止频率，用于新建滤波器参数结构体
f32 butterworth_lowpass_filter(butterworth_parameter_t *parameter, butterworth_buffer_t *buffer, f32 curr_input); // Butterworth低通滤波器




#endif
